# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Kyle Keen <keenerd@gmail.com>

pkgname=jupyter-nbformat
pkgver=5.8.0
pkgrel=3
pkgdesc='The base implementation of the Jupyter Notebook format and Python APIs for working with notebooks'
arch=(any)
url='https://pypi.python.org/pypi/nbformat'
license=(BSD)
depends=(python-traitlets python-jupyter-core python-jsonschema python-fastjsonschema)
makedepends=(python-build python-installer python-hatch-nodejs-version)
checkdepends=(python-pytest python-testpath python-pep440)
source=(https://github.com/jupyter/nbformat/archive/v$pkgver/nbformat-$pkgver.tar.gz)
sha256sums=('f153c23be35a01e5cdef01f51bc2b310fc2fe53da376e19fa12c10bcbcc64bbc')

build() {
  cd nbformat-$pkgver
  python -m build --wheel --no-isolation --skip-dependency-check
}

check() {
  cd nbformat-$pkgver
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest
}

package() {
  cd nbformat-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
